﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NTTDATA.BEENChina.ResultCertification.Checker.Numeric;
using System.ComponentModel;

namespace NTTDATA.BEENChina.ResultCertification.PropertyGridUtil.CustomObject
{
    [TypeConverter(typeof(CustomConverter))]
    public class ExpressionCondition : PropertyData
    {
        public string Expression1 { get; set; }
        public ComparisonOperator Compare { get; set; }
        public string Expression2 { get; set; }
        
        #region PropertyData impl
        public string GetDisplayName()
        {
            return this.Expression1 + this.Compare.ToString() + this.Expression2;
        }
        public string GetDescription()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(this.Expression1);
            sb.Append(",");
            sb.Append(this.Compare.ToString());
            sb.Append(",");
            sb.Append(this.Expression2);
            sb.Append(",");

            return sb.ToString();
        }

        public string GetValue()
        {
            return this.Expression1 + this.Compare.ToString() + this.Expression2;
        }
        #endregion
    }
}
